<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="timer">页面跳转</div>
</body>
<script>
    /**
     * 当timer中显示倒计时十秒钟
     * 时间到则跳转到百度的首页
    */
   var timer = document.getElementById("timer");
   var count = 10;
   var intervalID = setInterval(function(){
       count = count-1;
       timer.intervalID = count + "秒后将跳转到百度";
       if(count == 0){
           clearInterval(intervalID);
           location.href = "https://www.baidu.com/?tn=15007414_11_dg";
       }
   },1000);//每隔一秒刷新一次
</script>
</html>